package com.jy.rhin.facade.infra.schedule;

import com.jy.rhin.domain.notification.publish.PublishMessageDomainService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Description:
 * @Author: lww
 * @Date: 2022/11/17 15:17
 */
@Slf4j
@Component
public class MessageStatisticsSchedule {

    @Resource
    PublishMessageDomainService publishMessageDomainService;

    @Scheduled(cron = "${message.statistics.cron}")
    public void yesterdayTotalSchedule() {
        log.debug("-----每日统计昨天消息发送数量定时器：start ------------------------");
        publishMessageDomainService.saveYesterdayTotal();
        log.debug("-----每日统计昨天消息发送数量定时器：end ------------------------");
    }
}
